package cn.strive.eams.base.enmus;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum RoleEnum {
    INSTRUCTOR("10", "辅导员"),
    TEACHER("20", "教师"),
    HOUSEMASTER("30", "宿管"),
    MAINTENANCE_MAN("40", "维修员"),
    Driver("50", "校车司机"),
    HEADER_OF_SUBJECT("60", "学科长"),
    DIRECTOR_OF_TEACHER("70", "教研室主任"),
    MANAGEMENT_TEACHER("80", "部门管理员"),
    LOGISTICS("90", "后勤部老师"),
    DIRECTOR_OF_FINANCE("100", "财务部主任"),
    ALLOCATION("110", "资产管理老师");


    private String code;
    private String msg;

    public static RoleEnum fromCode(String role) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.getCode().equals(role)) {
                return roleEnum;
            }
        }
        return null;
    }
}
